fix(build): make uv sync work on fresh clones without the private indicium packages#30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
uv syncfails on every fresh clone withDistribution not found at: .../indicium, because[tool.uv.sources]points at three private sibling checkouts that exist only on maintainer machines. This removes them and adds two guards so the regression cannot recur silently.Fixes #29. The same defect was reported as #5 and fixed by #6; commit
940fd36reintroduced it while restoring the KG test suite.Why the previous fix did not hold
uvbuilds a universal lockfile, souv lockresolves every extra and every dependency-group regardless of which one the user requests. A single undeclarable requirement therefore breaks the defaultuv sync. The failure happens during resolution, before any Python runs — it reproduces with--offline.The three packages cannot be declared at all today:
indicium,indicium-adapters,indicium-adapters-metabolomicsare private repositories.indiciumon PyPI belongs to an unrelated project (a key-value store, latest0.1.0a3), so a bareindiciumrequirement resolves to the wrong package.Commit
940fd36re-enabled the extras to restore 43 tests that needindicium. That trade was invisible in CI because thetestjob installs withpip install -e ".[dev]", and pip ignores[tool.uv.sources]entirely.Changes
pyproject.toml: remove theindiciaandadaptersextras and the[tool.uv.sources]block. The comment now records why they must never come back, and how a maintainer installs the private stack without editing the file.pyproject.toml: add a publicgraph = ["rdflib>=6.0", "pyoxigraph>=0.4"]extra.indicium_layer/store.pyimportsrdflibunconditionally at module level andpyoxigraphfor the production store, yetrdflibwas never declared anywhere andpyoxigraphwas declared only inside the removedindiciaextra. Both are on PyPI, souv sync --extra graphworks for everyone..github/workflows/ci.yml: add auv-resolvejob that runsuv lockon a clean runner. A GitHub runner never has the sibling checkouts, so it is exactly an external user's environment. This is the check that would have caught940fd36.tests/unit/test_pyproject_packaging.py: a hermetic regression test rejecting local-path[tool.uv.sources]entries and any private distribution declared in base dependencies, extras, or dependency-groups.uv sync --extra indicia, which now fails withExtra `indicia` is not defined.Maintainer workflow
The private packages are installed into the synced environment rather than declared:
uv sync --extra dev --extra graph uv pip install -e ../indicium -e ../indicium-adapters -e ../indicium-adapters-metabolomics uv sync --inexact --extra dev --extra graph # --inexact, or uv prunes the editable installs--inexactis load-bearing: a plainuv syncuninstalls the editable siblings.Verification
uv lockanduv sync --dry-runsucceed in a clone with no sibling directories; before the change both emit the reported error.pyproject.tomlin an isolated tree makes both the new test anduv lockfail, so the guards are not vacuous. Injectingindiciuminto[dependency-groups]— which bypasses a naive check — is also rejected.test_web_app_routes.py,test_usage_guide.py) reproduce identically onmainwith the same environment and are unrelated to this change. They are being addressed separately.uv sync --extra graphinstallsrdflibandpyoxigraph.Notes
Two follow-ups are deliberately out of scope:
pytest.importorskipguards would let therdflib/pyoxigraph-only tests run there.indiciumunder that name is impossible while the PyPI name is taken; a rename or a private index is a separate decision.